/*
explain:接收用户输入的6个浮点数a,b,c,d,e,f，求解方程组ax+by=c,dx+ey=f。
 */

package com.yuan.algorithms.Algorithm_1;

import java.util.Scanner;
public class 解二元一次方程组 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            double a,b,c,d,e,f,X,Y;
            a = sc.nextDouble();
            b = sc.nextDouble();
            c = sc.nextDouble();
            d = sc.nextDouble();
            e = sc.nextDouble();
            f = sc.nextDouble();
            Y = (c*d-a*f)/(b*d-a*e);
            X = (c-b*Y)/a;
            System.out.printf("X=%.3f,",X);
            System.out.printf("Y=%.3f\n",Y);
        }
    }
    
}
